//
//  WNLoginManager.h
//  Whatnet_iOS
//
//  Created by 北辰 on 2019/4/19.
//  Copyright © 2019 什么网络. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "WNUserInfo.h"
#import "WALoginController.h"

@interface WNLoginManager : NSObject

@property(nonatomic, assign) CGFloat buy_minValue;
@property(nonatomic, assign) CGFloat buy_maxValue;

@property(nonatomic, assign) CGFloat sell_minValue;
@property(nonatomic, assign) CGFloat sell_maxValue;


@property(nonatomic, strong) NSString *udidStr;

@property(nonatomic, strong) WNUserInfo *userInfo;

+ (instancetype)manager;

/**
 设置用户的userID和token
 */
- (void)setUserIDAndToken:(NSDictionary *)dict;
/**
 是否在线
 */
- (BOOL)isloginOnline;

/**
 是否完成了认证
 */
- (BOOL)isAuthentication;

/**
 是否可发布任务
 */
- (BOOL)canPublish;

/**
 退出登录
 */
- (void)loginOut;

/**
 用户未定位

 @return 返回YES表示未定位
 */
- (BOOL)noLocation;

/**
 是否已经实名认证
 */
- (BOOL)isIdentityAuthentication;

//更新本地存储
- (BOOL)saveUserInfo;

/**
 更新实名认证

 @param tag 是否成功
 */
- (void)updateIdentityAuthentication:(BOOL)tag;

/**
 跳转至登录页面
 @param dismissBlock 登录页面退出时的回调
 */
- (void)presentLoginView:(DismissBlcok)dismissBlock;

- (NSString *)getUDID;
/**
 //显示设置年龄和性别视图，用户信息必须完善
 */
- (void)showSetAgeAndGenderView;


/**
 刷新用户数据-这个不会返回头像
 */
- (void)updateUserInfo:(DismissBlcok)dismissBlock;

/**
 刷新用户数据-会返回用户头像
*/
- (void)updateUserHeadImageAndUserInfo:(DismissBlcok)dismissBlock;

//登录页面是否已经显示
- (BOOL)loginVCIsVisible;

//z设备是否认证了
- (BOOL)deviceIsAuthentication;
@end




@interface NSObject (WNUser)
@property(nonatomic, strong) WNLoginManager *loginManager;
//保存deviceToken
- (void)saveDeviceToken:(NSString *)token;
- (NSInteger)userID_Int;

- (NSString *)userID_String;

+ (NSInteger)userID_Int;

+ (NSString *)userID_String;
//获取deviceToken
- (NSString *)getDeviceToken;
@end
